﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddDeliverMajor.aspx.cs"
    Inherits="ZX.WebApp.Crm.Deliver.AddDeliverMajor" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/calendar/assets/skins/sam/calendar.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/calendar/calendar-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/resize/resize-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>
    <script src="../../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../../Scripts/CombinButton.js" type="text/javascript"></script>
    <script src="../../Scripts/extend.validate.js" type="text/javascript"></script>
    <link href="../../Styles/base.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/extendTable.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #yui-dt15-th-ClassName-liner span, #yui-dt15-th-PrintClassName-liner span, 
        #yui-dt15-th-Sex-liner span, #yui-dt15-th-Post-liner span, #yui-dt15-th-IsDecision-liner span, 
        #yui-dt15-th-ArriveatTime-liner span, #yui-dt15-th-HouseType-liner span, #yui-dt15-th-IsGaiQi-liner span, 
        #yui-dt15-th-ShouJi-liner span
        {
            color: Red;
        }
    </style>
</head>
<body class="yui-skin-sam" onkeydown="PreventBSK()">
    <form id="form1" runat="server">
    <div>
        <div id="toolbar" style="margin-top: 12px; text-align: center;">
            <button type="button" id="btnSave" name="btnSave">
                保存</button>
            <button type="button" id="btnSave1" name="btnSave1">
                提交</button>
            <button type="button" id="btnBack" name="btnBack">
                退回</button>
            <button type="button" id="btnClose" name="btnClose">
                取消</button>
        </div>
        <div class="fieldForm" id="fieldForm">
            <div id="content">
                <h3>
                    基本信息</h3>
                <table class="table1">
                    <tr>
                        <th>
                            <span style="color: Red;">*</span><span>交付单号</span>
                        </th>
                        <td>
                            <asp:TextBox ID="Code" runat="server" ReadOnly="true" class="width60" BackColor="#e7eaf4"></asp:TextBox>
                        </td>
                        <td colspan="2">
                            &nbsp;
                        </td>
                        <th>
                            <span style="color: Red;">*</span><span>订单日期</span>
                        </th>
                        <td>
                            <asp:TextBox ID="AddTime" runat="server" ReadOnly="true" class="width60" BackColor="#e7eaf4"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th width="11%">
                            <span style="color: Red">*</span><span>订单号</span>
                        </th>
                        <td width="22%">
                            <input type="hidden" id="OrderID" name="OrderID" runat="server" />
                            <input type="text" id="txtOrderID" name="txtOrderID" readonly="readonly" class="width60"
                                runat="server" />
                            <button id="btnOrderID" name="1" type="button" runat="server" class="btnCheck" style="height: 25px;">
                                选择</button>
                            <input type="hidden" id="OrderIDS" name="OrderIDS" runat="server" />
                            <input type="text" id="txtOrderIDS" name="txtOrderIDS" readonly="readonly" class="width60"
                                runat="server" style="display:none;" />
                            <button id="btnOrderIDS" name="-1" type="button" runat="server" class="btnCheck" style="height: 25px; display:none;">
                                选择</button>
                        </td>
                        <th width="11%">
                            <span>客户名称</span>
                        </th>
                        <td width="23%">
                            <input type="hidden" id="CustomerId" runat="server" />
                            <input type="text" runat="server" id="CustomerName" readonly="readonly" class="width60" />
                        </td>
                        <th width="11%">
                            <span>客户来源</span>
                        </th>
                        <td width="23%">
                            <input type="text" runat="server" id="CustomerSource" readonly="readonly" class="width60" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span style="color: Red">*</span><span>产品列表</span>
                        </th>
                        <td>
                            <input type="hidden" id="ProductId" runat="server" />
                            <asp:DropDownList ID="ProductList" runat="server" class="width65">
                            </asp:DropDownList>
                        </td>
                        <th>
                            <span>成交数量</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="Account" readonly="readonly" class="width60" />
                        </td>
                        <th>
                            <span>已交付数量</span>
                        </th>
                        <td>
                            <input type="text" id="PayAccount" readonly="readonly" class="width60" />
                        </td>
                        
                    </tr>
                    <tr>
                        <th>
                            <span>应缴款</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="Pay1" readonly="readonly" class="width60" />
                        </td>
                        <th>
                            <span>已缴款</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="Pay3" readonly="readonly" class="width60" />
                        </td>
                        <th>
                            <span>未缴款</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="Pay2" readonly="readonly" class="width60" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span>客户经理</span>
                        </th>
                        <td>
                            <input type="hidden" id="CustomerMgr" name="CustomerMgr" runat="server" />
                            <input type="text" runat="server" id="txtCustomerMgr" name="txtCustomerMgr" readonly="readonly" class="width60" />
                            <button id="btnCustomerMgr" name="Z" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th>
                            <span>客户总监</span>
                        </th>
                        <td>
                            <input type="hidden" id="CustomerDirector" runat="server" />
                            <input type="text" runat="server" id="txtCustomerDirector" readonly="readonly" class="width60" />
                            <button id="btnCustomerDirector" name="Z" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th>
                            <span>分总</span>
                        </th>
                        <td>
                            <input type="hidden" id="CustomerManager" runat="server" />
                            <input type="text" runat="server" id="txtCustomerManager" readonly="readonly" class="width60" />
                            <button id="btnCustomerManager" name="Z" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span style="color: Red">*</span><span>课中服务人</span>
                        </th>
                        <td>
                            <input type="hidden" id="ClassServer" runat="server" />
                            <input type="text" runat="server" id="txtClassServer" readonly="readonly" class="width60" />
                            <button id="btnClassServer" name="Z" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th>
                            <span style="color: Red">*</span><span>负责交付人</span>
                        </th>
                        <td>
                            <input type="hidden" id="ClassFrontServer" runat="server" />
                            <input type="text" runat="server" id="txtClassFrontServer" readonly="readonly" class="width60" />
                            <button id="btnClassFrontServer" name="Z" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th>
                            <span>谈单老师</span>
                        </th>
                        <td>
                            <input type="hidden" id="NegotiateTeach" runat="server" />
                            <input type="text" runat="server" id="txtNegotiateTeach" readonly="readonly" class="width60" />
                            <button id="btnNegotiateTeach" name="Z" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span style="color: Red">*</span><span>课程规划期数</span>
                        </th>
                        <td>
                            <input type="hidden" id="ProductLayoutID" runat="server" />
                            <input type="text" runat="server" id="txtProductLayoutID" readonly="readonly" class="width60" />
                            <button id="btnProductLayoutID" name="K" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th>
                            <span>日期</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="Date" readonly="readonly" class="width60" />
                        </td>
                        <th>
                            <span>地点</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="Address" readonly="readonly" class="width60" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span>签到负责人</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="SignPeople" readonly="readonly" class="width60" />
                        </td>
                        <th>
                            <span>总负责人</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="AllSignPeople" readonly="readonly" class="width60" />
                        </td>
                        <th>
                            <span>上课人数</span>
                        </th>
                        <td>
                            <input type="text" id="ClassNumber" readonly="readonly" class="width60" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span style="color: Red">*</span><span>是否现场完款</span>
                        </th>
                        <td>
                            <asp:DropDownList ID="exp3" runat="server" class="width65" AppendDataBoundItems="true">
                                <asp:ListItem Value=""></asp:ListItem>
                                <asp:ListItem Value="0">否</asp:ListItem>
                                <asp:ListItem Value="1">是</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <th>
                            <span>业绩成本归属</span>
                        </th>
                        <td>
                            <input type="hidden" id="GradeDeptId" name="GradeDeptId" runat="server" />
                            <input id="txtGradeDeptId" name="txtGradeDeptId" runat="server" readonly="readonly"
                                type="text" class="width60" />
                            <button id="btnGradeDeptId" name="G" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th>
                            <span>交付成本归属</span>
                        </th>
                        <td>
                            <input type="hidden" id="ConstDeptId" name="ConstDeptId" runat="server" />
                            <input id="txtConstDeptId" name="txtConstDeptId" runat="server" readonly="readonly"
                                type="text" class="width60" />
                            <button id="btnConstDeptId" name="G" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th style="display: none;">
                            <span>是否终身复训</span>
                        </th>
                        <td style="display: none;">
                            <asp:DropDownList ID="IsAll" runat="server" class="width65">
                                <asp:ListItem Value=""> </asp:ListItem>
                                <asp:ListItem Value="0">否</asp:ListItem>
                                <asp:ListItem Value="1">是</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span>填单人</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="txtAddOrderUser" readonly="readonly" class="width60" />
                        </td>
                        <th>
                            <span>填单时间</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="txtAddOrderTime" readonly="readonly" class="width60" />
                        </td>
                        <th id="tdState1">
                            <span>状态</span>
                        </th>
                        <td id="tdState2">
                            <asp:DropDownList ID="DliverState" runat="server" class="width65">
                            </asp:DropDownList>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="extendDiv">
                <div id="con_two_1">
                    <h3>
                        学员信息
                        <button type="button" id="btnNew1" name="btnNew1">
                            新增</button>
                        <button type="button" id="btnDelete1" name="btnDelete1">
                            删除</button>
                        <button type="button" id="btnAddTrain" name="btnAddTrain">
                            新增复训</button>
                    </h3>
                    <div id="con_1">
                    </div>
                </div>
            </div>
            <div id="extendContent">
                <table id="table1" class="table1">
                <tr>
                    <th width="11%"><span>审核人</span></th>
                    <td width="22%">
                        <input type="hidden" id="AddUser" runat="server" />
                        <input type="text" runat="server" id="txtAddUser" readonly="readonly" class="width60" />
                    </td>
                    <th width="11%">
                        <span>审核时间</span>
                    </th>
                    <td width="22%">
                        <input type="text" runat="server" id="txtAddTime" readonly="readonly" class="width60" />
                    </td>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <th width="11%">
                        <span>确认人</span>
                    </th>
                    <td width="22%">
                        <input type="hidden" id="SureUser" />
                        <input type="text" id="txtSureUser" readonly="readonly" class="width60" />
                        <button id="btnSureUser" name="Z" type="button" class="btnCheck" style="height: 25px;">
                            选择</button>
                    </td>
                    <th width="11%">
                        <span>确认时间</span>
                    </th>
                    <td width="22%">
                        <input type="text" id="txtSureTime" readonly="readonly" class="width60" />
                    </td>
                    <td colspan="2">&nbsp;</td>
                </tr>
            </table>
            </div>
        </div>
        <div id="dialog1" class="yui-pe-content">
            <div class="hd">
                信息选择</div>
            <div class="bd">
                <iframe id="EditUIWindow1" frameborder="0" src="" style="width: 100%; height: 100%;
                    margin: 0px; padding: 0px;"></iframe>
            </div>
        </div>
        <div id="dialog2" class="yui-pe-content">
            <div class="hd">
                信息选择</div>
            <div class="bd">
                <iframe id="EditUIWindow2" frameborder="0" src="" style="width: 100%; height: 100%;
                    margin: 0px; padding: 0px;"></iframe>
            </div>
        </div>
        <div id="dialog3" class="yui-pe-content">
            <div class="hd">
                退回原因</div>
            <div class="bd">
                <textarea id="txtReturn" name="txtReturn" style="width: 98%; height: 95%;"></textarea>
            </div>
        </div>
        <input type="hidden" id="ID" runat="server" />
        <input type="hidden" id="OrderProductID" runat="server" />
        <input type="hidden" id="WorkFlowInsId" runat="server" />
        <input type="hidden" id="WorkTaskInsId" runat="server" />
        <input type="hidden" id="txtAddTrain" runat="server" />
    </div>
    </form>
    <form id="form2" style="display: none" action="">
    <textarea style="display: none" id="jsonDataContent" rows="2" cols="2" name="jsonDataContent"></textarea>
    </form>
</body>
<script src="../../Scripts/Appjs/model.AddDeliverMajor.js" type="text/javascript"></script>
<script type="text/javascript">
    var entity = "<% =EntityName %>",flag="<%=Flag %>",addUser="<%=addUser %>",
        view="<%=strView %>",OperStatus="<%=strOperStatus %>",type="<%=Type %>",
        action="<% =DataAction %>",Descript="<%=strDescript %>",fkey="<%=Fkey %>",
        WorkFlowId="<%=strWorkFlowId %>",WorkTaskId="<%=strWorkTaskId %>",
        OperatorInstanceId="<%=strOperatorInstanceId %>",
        WorkflowInsId="<%=strWorkflowInsId %>",WorkTaskInsId="<%=strWorkTaskInsId %>",
        HouseType=[<%=ListDetailHouseType %>],
        TrafficType=[<%=ListDetailTrafficType %>],
        MinZu=[<%=ListMinZu %>],
        DeliverMajorInfo=[<%=ListDeliverMajorInfo %>];
    var getTsid=$("#WorkTaskInsId").val();
    var vid = $("#ID").val();
    var myDataSource1, mDataTable1, mDataTable2;
    var btnSave = "",btnSave1="",btnNews1="",btnDeletes1="",
        btnBack="",btnClose = "",btnAddTrain="",condition = "";
    <asp:Literal ID="EditTemplate" runat="server"></asp:Literal>

    (function () {
        if(type=="0") { //排位表中跳转过来新增
            $("#txtOrderID").hide();
            $("#txtOrderIDS").show();
            $("#btnOrderID").hide();
            $("#btnOrderIDS").show();
            $("#exp3").get(0).selectedIndex = 1;
            LoadProductLayoutByType();
        }
        var trs = $("#table1 tr");
        for (var i = 0; i < trs.length; i++) {
            trs[i].style.display = "none";
        }
        if(flag=="0"){ //新增
            $('#DliverState').attr("disabled","true");
        }
        //加载流程结束
        if (Descript == "ck") {
            var Dom = YAHOO.util.Dom,
            Event = YAHOO.util.Event;
            Event.onDOMReady(function () {
                var layout = new YAHOO.widget.Layout({
                    units: [
                    { position: 'center', body: 'fieldForm', gutter: '0 1 1 1', scroll: true }
                    ]
                });
                layout.render();
            });
            Save1(1);
        }else{
            var Dom = YAHOO.util.Dom,
                Event = YAHOO.util.Event;
            Event.onDOMReady(function () {
                var layout = new YAHOO.widget.Layout({
                    units: [
                    { position: 'bottom', height: 60, body: 'toolbar', gutter: '1 1 1 1', scroll: null, zIndex: 2 },
                    { position: 'center', body: 'fieldForm', gutter: '0 1 1 1', scroll: true }
                    ]
                });
                layout.render();
            });
        }
    })();
    //关闭当前页
    var Close = function () {
        window.parent.$("#tabs").tabs('close', '<%=PageTitle %>');
    }
</script>
</html>
